<?php
function pageList($pageCount,$page,$up){
    $pageStart=1;
    if($pageCount>21&&$page>11){
        if($pageCount-$page<=10){
            $pageStart=$pageCount-20;
        }else{
            $pageStart=$page-10;
        }
    }
    if ($pageStart!=1){
        echo "<a href='?page=1$up'>首页</a>";
    }
    if ($page!=1){
        echo "<a href='?page=".($page-1)."$up'>上一页</a>";
    }
    for ($i=$pageStart;$i<=($pageCount<21?$pageCount:$pageStart+20);++$i){
        if ($i==$page){
            echo "<span>$i</span>";
        }else{
            echo "<a href='?page=$i$up'>$i</a>";
        }
    }
    if ($page<$pageCount){
        echo "<a href='?page=".($page+1)."$up'>下一页</a>";
    }
    if($pageStart<$pageCount-20){
        echo "<a href='?page=".$pageCount."$up'>尾页</a>";
    }
}
?>
<?php

$ratio1=$core->GetRatioByRank("一级")["ratio"];
$ratio2=$core->GetRatioByRank("二级")["ratio"];
$ratio3=$core->GetRatioByRank("三级")["ratio"];
?>
<div class="modal fade" id="dg">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">分佣比例设置</div>
            </div>
                <div class="modal-body">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="control-label col-xs-5">一级比例%</label>
                            <div class="col-xs-7">
                                <input  type="number" min="0" value="<?php echo $ratio1; ?>" class="form-control " name="ratio1" required>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-5">二级比例%</label>
                            <div class="col-xs-7">
                                <input  type="number" min="0" value="<?php echo $ratio2; ?>" class="form-control " name="ratio2" required>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-xs-5">三级比例%</label>
                            <div class="col-xs-7">
                                <input  type="number" min="0" value="<?php echo $ratio3; ?>" class="form-control " name="ratio3" required>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button onclick="bspst()"  type="submit" class="btn btn-primary" data-dismiss="modal">确定</button>
                    <button  type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                </div>
        </div>
    </div>
</div>
<div class="pl inlb bd col-xs-2">
    <div class="list-group lst" style="margin-top: 80px">
        <?php
        $arr1=["NormalUserManage.php","managerManage.php","bonusManage.php","earningReport.php","NonUseUserManage.php","set.php"];
        $arr2=["会员管理","管理员管理","提现管理","业绩报表","黑名单管理","系统设置"];
        for($i=0;$i<count($arr1);++$i){
            echo "<a href='".$arr1[$i]."' class='list-group-item ".((isset($Item)&&$Item==$arr2[$i])?"active":"")."'>".$arr2[$i]."</a>";
        }
        if($manager["role"]=="超级管理员")
            echo "<a href='Prize.php' class='list-group-item ".((isset($Item)&&$Item=="奖品管理")?"active":"")."'>奖品管理</a>";
        echo "<a href='AddMgr.php' class='list-group-item ".((isset($Item)&&$Item=="添加管理员")?"active":"")."'>添加管理员</a>";
        echo "<a onclick='cgbspst()' href='#' class='list-group-item '>修改佣金比例</a>";
        ?>
    </div>
</div>
<script>
    function bspst(){
        var ratio1=$("input[name=ratio1]").val()
        var ratio2=$("input[name=ratio2]").val()
        var ratio3=$("input[name=ratio3]").val()
        $.post("getMessage.php",{ratio1:ratio1,ratio2:ratio2,ratio3:ratio3},function(o){
        })
        return false;
    }
    function cgbspst(){
        $("#dg").modal("show")
    }
</script>
